﻿Public Class FormCurrent
    Dim objProdInfo As New clsProdInfo
    Private Sub FormCurrent_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        setDgvData()
    End Sub
    Private Sub setDgvData()
        Dim dt As DataTable = objProdInfo.getLHList()
        dgv.Font = New Font("UTF-8", 12)
        If dt.Rows.Count > 0 Then
            For Each row As DataRow In dt.Rows
                If DBNull.Value.Equals(row("into_vu_time")) = False And DBNull.Value.Equals(row("lh_total_duration")) = False Then
                    Dim temp_time_length As Double = Double.Parse(row("lh_total_duration"))
                    'Double.Parse(row("time_length_1")) + Double.Parse(row("time_length_2")) + Double.Parse(row("time_length_3"))
                    row("comp_time") = DateTime.Parse(row("into_vu_time")).AddMinutes(temp_time_length).ToString()
                End If
            Next
        End If
        Dim dv As DataView = dt.DefaultView
        dv.Sort = " comp_time Asc"
        Dim dtnew As DataTable = dv.ToTable()
        dgv.AutoGenerateColumns = False
        dgv.DataSource = dtnew
    End Sub
End Class